#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int a, n = 0;
    scanf("%d", &a);
    for (; a != 0; a /= 10)
    {
        if (a % 10 == 7)
        {
            ++n;
        }
    }
    printf("%d", n);
}